<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;
// return [
//     '__pattern__' => [
//         'name' => '\w+',
//     ],
//     '[hello]'     => [
//         ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
//         ':name' => ['index/hello', ['method' => 'post']],
//     ],

// ];

Route::rule('/', 'index/index/index');
Route::rule('hello', 'index/hello/hello');
Route::rule('fff', 'index/index/fff');
Route::rule('test', 'index/index/test');
Route::rule('demo', 'index/index/demo');
Route::rule('demo2', 'index/index/demo2');
Route::rule('demo3', 'index/index/demo3');
Route::rule('demo4', 'index/index/demo4');
Route::rule('demo5', 'index/index/demo5');
Route::rule('demo6', 'index/index/demo6');
Route::rule('demo7', 'index/index/demo7');
Route::rule('getinfo', 'index/users/getUsersInfo');
Route::rule('change', 'index/users/change');
Route::rule('test', 'index/users/test');

Route::rule('roles', 'index/roles/index');
// HTTPS 检测
// Route::get('/', 'index/index/index', ['https'=>true]);
// 域名检测
// Route::get('/', 'index/index/index',['domain' => 'www.checkhosts.com']);
// 前置行为检测
Route::get('/','index/index/index',['before_behavior'=>'\app\index\behavior\Hello']);
// Route::get('/','index/index/index',['callback'=>'my_check_fun']);

// 重定向到外部网址
Route::rule('baidu', 'https://www.baidu.com');

// 给User控制器设置快捷路由
Route::controller('users','index/Users');